﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;

namespace SysHelper
{
    public static class Images
    {
        #region 1.0 将图片转换成二进制 +byte[] FormatImage(string imagePath)
        /// <summary>
        /// 1.0 将图片转换成二进制
        /// </summary>
        /// <param name="imagePath"></param>
        /// <returns></returns>
        public static byte[] FormatImage(string imagePath)
        {
            using (FileStream fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read))
            {
                byte[] mybyte = new byte[fs.Length];
                fs.Read(mybyte, 0, mybyte.Length);

                return mybyte;
            }
        }
        #endregion

    }
}
